import BarBase from "./bar-base";
import BarStack from "./bar-stack";
import ColumnBase from "./column-base";
import ColumnStack from "./column-stack";
import LineBase from "./line-base";
import LineArea from "./line-area";
import PieBase from "./pie-base";
import PieCirque from "./pie-cirque";
import PieRose from "./pie-rose";
import TableList from "./table-list";
import KpiSingle from "./kpi-single";
import MixLineBar from "./mix-line-bar";
import MixLineBarMultiaxis from "./mix-line-bar-multiaxis";
import GraphBase from "./graph-base";
import FlowBase from "./flow-base";
import ProcessTopology from "./process-topology";
import MapBase from "./map-base";
import MapScatter from "./map-scatter";
import MapBar from "./map-bar";
import MapLines from "./map-lines";
import TableSingle from "./table-single";
import ColumnCustom from "./column-custom-1";
import WordCloud from "./word-cloud";
import KpiKeyValue from "./kpi-key-value";
import Funnel from "./funnel";
import Sunburst from "./sunburst";
import Sankey from "./sankey";
import SunburstCustom from "./sunburst-custom";
import Antv from "./antv";

const SourceList = [
  BarBase,
  BarStack,
  ColumnBase,
  ColumnStack,
  ColumnCustom,
  LineBase,
  LineArea,
  MixLineBar,
  MixLineBarMultiaxis,
  PieBase,
  PieCirque,
  PieRose,
  TableList,
  TableSingle,
  KpiSingle,
  KpiKeyValue,
  GraphBase,
  FlowBase,
  ProcessTopology,
  MapBase,
  // MapBar,
  MapScatter,
  MapLines,
  WordCloud,
  Funnel,
  // Sunburst,
  Sankey,
  SunburstCustom,
  Antv,
];

const ChartList = SourceList.reduce((r, c) => {
  r.push(new c());
  return r;
}, []);

export { ChartList };

export const getChartInstance = (type) => {
  return ChartList.find((chart) => chart.getInfo().type === type);
};
